﻿using RewriteWeatherApp.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RewriteWeatherApp.CallBoard
{
    class AccountDisplay : IDisplayElement, IMyAccountsObserver
    {
        string username;
        DateTime updatetime;
        public AccountDisplay(IMyAccountsSubject myAccounts)
        {
            myAccounts.RegisterObserver(this);
        }
        public void DisPlay()
        {
            Console.WriteLine($"{username}  {updatetime}");
        }

        public void Update(string username, DateTime updatetime)
        {
            this.username = username;
            this.updatetime = updatetime;
            DisPlay();
        }
    }
}
